home *** CD-ROM | disk | FTP | other *** search
/ isnet Internet / Isnet Internet CD.iso / prog / hiz / 09 / 09.exe / adynware.exe / perl / lib / newgetopt.pl < prev    next >
Encoding:
Text File  |  1999-12-28  |  1.6 KB  |  60 lines

  1.  
  2. {   package newgetopt;
  3.  
  4.     $REQUIRE_ORDER = 0;
  5.     $PERMUTE = 1;
  6.     $RETURN_IN_ORDER = 2;
  7.  
  8.     if ( defined $ENV{"POSIXLY_CORRECT"} ) {
  9.     $autoabbrev = 0;    # no automatic abbrev of options (???)
  10.     $getopt_compat = 0;    # disallow '+' to start options
  11.     $option_start = "(--|-)";
  12.     $order = $REQUIRE_ORDER;
  13.     $bundling = 0;
  14.     $passthrough = 0;
  15.     }
  16.     else {
  17.     $autoabbrev = 1;    # automatic abbrev of options
  18.     $getopt_compat = 1;    # allow '+' to start options
  19.     $option_start = "(--|-|\\+)";
  20.     $order = $PERMUTE;
  21.     $bundling = 0;
  22.     $passthrough = 0;
  23.     }
  24.  
  25.     $debug = 0;            # for debugging
  26.     $ignorecase = 1;        # ignore case when matching options
  27.     $argv_end = "--";        # don't change this!
  28. }
  29.  
  30. use Getopt::Long;
  31.  
  32.  
  33. sub NGetOpt {
  34.  
  35.     $Getopt::Long::debug = $newgetopt::debug 
  36.     if defined $newgetopt::debug;
  37.     $Getopt::Long::autoabbrev = $newgetopt::autoabbrev 
  38.     if defined $newgetopt::autoabbrev;
  39.     $Getopt::Long::getopt_compat = $newgetopt::getopt_compat 
  40.     if defined $newgetopt::getopt_compat;
  41.     $Getopt::Long::option_start = $newgetopt::option_start 
  42.     if defined $newgetopt::option_start;
  43.     $Getopt::Long::order = $newgetopt::order 
  44.     if defined $newgetopt::order;
  45.     $Getopt::Long::bundling = $newgetopt::bundling 
  46.     if defined $newgetopt::bundling;
  47.     $Getopt::Long::ignorecase = $newgetopt::ignorecase 
  48.     if defined $newgetopt::ignorecase;
  49.     $Getopt::Long::ignorecase = $newgetopt::ignorecase 
  50.     if defined $newgetopt::ignorecase;
  51.     $Getopt::Long::passthrough = $newgetopt::passthrough 
  52.     if defined $newgetopt::passthrough;
  53.  
  54.     &GetOptions;
  55. }
  56.  
  57.  
  58. 1;
  59.  
  60.